package com.ioday01demo;
/*
缓冲字符输入流读取文本数据

 */

import java.io.*;
import java.nio.charset.StandardCharsets;

public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("pw.txt");
        //转换流连接字节流和字符流  转换流确定 字符编码集
        InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
        //缓冲字符流 底层是8kb的字符数组  加快字节读取
        BufferedReader br  = new BufferedReader(isr);
        String line;
        //readLine()方法一次读取一整行  句尾的换行符读出为 "" 读不到为空
        while ((line = br.readLine())!=null){
            System.out.println(line);
        }
        br.close();


    }
}
